using System;
using System.Collections.Generic;
using NUnit.Framework;
using SpecMaker.Core;
using SpecMaker.Core.Interfaces;
using SpecMaker.UnitTests.SupportClasses;

namespace SpecMaker.UnitTests
{
    [TestFixture]
    public class Spec_SpecFinder
    {
        private List<Type> _types;
        private SpecFinder _finder;

        [SetUp]
        public void SetUp()
        {
            _finder = new SpecFinder();
            _types = new List<Type> {typeof (TestBaseContainer)};
        }
        [Test]
        public void should_find_all_impl_of_ispeccontainer()
        {
            ISpecContainer[]  impl = _finder.GetImpl(_types.ToArray());
            Assert.AreEqual(1, impl.Length);
        }

        [Test]
        public void should_instantiate_speccontainer_with_contructors_if_the_other_types_are_in_parameter()
        {
            _types.Add(typeof(ContructorTestContainer));
            ISpecContainer[] imple = _finder.GetImpl(_types.ToArray());
            Assert.AreEqual(2, imple.Length);

        }
    }
}